#!/bin/bash

echo "Starting Linux Basic Container..."
echo

# 进入脚本所在目录
cd "$(dirname "$0")"

echo "Building and starting container..."
docker-compose up -d --build

if [ $? -eq 0 ]; then
    echo
    echo "✅ Container started successfully!"
    echo
    echo "SSH Connection Info:"
    echo "  Host: localhost"
    echo "  Port: 2222"
    echo "  Users:"
    echo "    - root (password: root123)"
    echo "    - developer (password: dev123)"
    echo
    echo "Example SSH commands:"
    echo "  ssh root@localhost -p 2222"
    echo "  ssh developer@localhost -p 2222"
    echo
    echo "To stop the container: docker-compose down"
    echo "To view logs: docker-compose logs -f"
else
    echo "❌ Failed to start container!"
    echo "Check the error messages above."
    exit 1
fi